package cn.edu.kzjsxy.graduationproject.common;

/**
 * @Author：chén jiā jùn
 * @Create：2024年03月27日17:34
 * 状态码枚举类
 */

public enum ResultCode {
	SUCCESS(200, "成功"),
	CREATED(201, "创建成功"),
	NO_CONTENT(204, "无内容"),
	BAD_REQUEST(400, "请求错误"),
	UNAUTHORIZED(401, "用户不存在或者密码错误"),
	UNPROCESSABLE_ENTITY(422, "请求格式正确，但由于语义错误无法处理"),
	SERVER_ERROR(500, "服务器内部错误"),
	/**
	 * token
	 */
	FAIL(505,"失败");

	private final int code;
	private final String message;

//	token
	public static final String TOKEN = "token";

	ResultCode(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
}
